﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace J.CustomerGet
{
    public class MyExceptionFilter : IExceptionFilter
    {
        private readonly ILogger<MyExceptionFilter> _logger;
        public MyExceptionFilter(ILogger<MyExceptionFilter> logger)
        {
            _logger = logger;
        }
        public void OnException(ExceptionContext context)
        {
            _logger.LogError($"全局异常信息：{context.Exception.StackTrace}");
        }
    }
}
